
(require 'skeleton)

;;;;;;;
;; Auto-pairing is done by skeleton-mode
(setq skeleton-pair nil)
(setq skeleton-pair-on-word nil)


(define-skeleton c-skeleton-function-header
   "A comment header of a C function" nil
   "/**\n"
   " * \\brief " (read-string "Brief description:")
   "\n *"
   ((read-string "Parameter: ") "\n * \\param" str)
   "\n *"
   ((read-string "Returns: ") "\n * \\return " str)
   "\n *\n"
   " * */\n")

(define-skeleton c-skeleton-preproc-if
   "A simple preprocessor ifdef directive." nil
   "#if (" (setq str (read-string "Diretive condition: ")) ")\n"
   _ "\n#endif /* " str " */")

(define-skeleton c-skeleton-preproc-ifdef
   "A simple preprocessor ifdef directive." nil
   "#ifdef " (setq str (read-string "Diretive condition: ")) "\n"
   _ "\n#endif /* " str " */")

(define-skeleton c-skeleton-preproc-define
   "A simple preprocessor definition." nil
   "/** \\brief " (read-string "Brief description: ") "\n"
   " */\n"
   "#define " _ "\n")

(define-skeleton c-skeleton-preproc-include
   "A simple preprocessor include." nil
   "#include \"" _ "\"")

(define-skeleton c-skeleton-open-curly-braces
  "Put a pair of curly braces with proper indention." nil
  "{" > "\n" > _ "\n}" > )

(provide 'resource/skeletons)
